|
|
|
|
|
|
|
controller, part of the Graphical User Interface (and often Business Rules) Subsystem, communicates with the interface class of the Reporting and Printing Subsystem, IReporting. Depending on the adapter implementation class chosen (such as AccessReporting, CrystalReporting, or RichTextReporting), the report is opened or built and then sent to the PrinterProxy class for actual printing. |
|
|
|
|
|
|
|
|
Listing 20.2 shows the important methods involved in the communication between the two subsystems for the purpose of requesting a report. Listing 20.3 shows the printing requests as they are implemented between the subsystems. In the Second Bank of Carrollton example, the CashDepositRecord class communicates with IReporting in the manner of these two listings. |
|
|
|
|
|
|
|
|
LISTING 20.2. THE CLASS METHODS IN THE COMMUNICATION BETWEEN THE TWO SUBSYSTEMS. THE INTERACTION OF THESE METHODS IS NECESSARY FOR REQUESTING A REPORT. |
|
|
|
 |
|
|
|
|
1: 'In a form controller class, such as CashDepositRecord
2: Public Sub clickedOpenReport(Optional argReportName As String,
Optional argReportType As Byte)
3: Dim bReportType As Byte
4: Screen.MousePointer = vbHourglass
5: bReportType = eReporting.RichTextReporting 'Implemented
6: ' bReportType = eReporting.AccessReporting 'Not implemented
7: ' bReportType = eReporting.CrystalReporting 'Not implemented
8:
9: 'Only one of these three calls
10: 'will be able to process message
11: setRichTextReporting bReportType
12: setAccessReporting bReportType
13: setCrystalReporting bReportType
14:
15: Polymorphic call to openReport() method
16: theReporting.openReport theForm.txtReportName
17: Screen.MousePointer = vbDefault
18:
19: End Sub
20:
21: 'In RichTextReporting
22: Private Function IReporting_openReport(Optional _
23: argRptName As String) ', _
24: Optional argContents) As Variant
25: 'If Not IsMissing(argContents) Then mvarContents = argContents
26: 'theReportController.showForm
27: mvarReportName = argRptName
28: EveryCashDepositRecord.buildReport mvarReportName, theRichTextBox
29: End Function
|
|
|
|
|
|